]> dgit.raspbian.org Git - gnome-shell.git/commit
loginManager: Use signal argument to detect preparing for sleep
authorSebastian Keller <skeller@gnome.org>
Wed, 26 Mar 2025 10:28:30 +0000 (11:28 +0100)
committerMarge Bot <marge-bot@gnome.org>
Mon, 31 Mar 2025 11:40:18 +0000 (11:40 +0000)
commitbdecbafc5d3085716814734d33a7dcdb8e05b9d6
treee84f17049ff4c20316355a3894f71c2590cf3511
parent2266a4539c65310f46c3f40f3a72f38becb19b93
loginManager: Use signal argument to detect preparing for sleep

The DBus PreparingForSleep property on org.freedesktop.login1.Manager
does not trigger PropertyChanged signals, leading to wrong values due to
gdbus caching. In most cases it would have always been false.

Additionally it was not included in the XML interface description file
included in gnome-shell. So it was actually undefined.

Since this property is used in _calculateUserStateFromLogind() to
determine that a user is not active when closing the lid on a laptop,
the user was considered still active.

Fix this by storing the "start" argument from the PrepareForSleep signal
instead of trying to read from the property.

Fixes: 6a43b6f55 ("timeLimitsManager: Store screen time state on suspend/resume")
Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8185
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3679>
js/misc/loginManager.js